package com.foreknow.demo10;

public class Person {
    private String name;
    private int age;

    public Person(int i){
        this.age = i;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public static void main(String[] args) {
        Person p1 = new Person(10);
        Person p2 = new Person(10);
        System.out.println(p1==p2); //false
        System.out.println(p1.equals(p2)); //false  因为调用的是Object中的equals方法而不是String中的equals方法
    }
}
